from enum import Enum


class Task:
    def __init__(self, 
                 computing_re, 
                 bandwidth_re, 
                 taskID, 
                 consumerID):
        # 初始信息
        self.taskID = taskID
        self.ownerID = consumerID
        self.processorID = None

        self.computing_re = computing_re
        self.bandwidth_re = bandwidth_re

        self.computing_remind = self.computing_re   # 初始化剩余计算量
        self.bandwidth_remind = self.bandwidth_re   # 初始化剩余传输量

        self.process_time = 0
        self.transmit_time = 0

    def set_processor(self, processorID):
        self.processorID = processorID


class Task_type(Enum):
    C1B9 = (10, 90)
    C2B8 = (20, 80)
    C3B7 = (30, 70)
    C4B6 = (40, 60)
    C5B5 = (50, 50)
    C6B4 = (60, 40)
    C7B3 = (70, 30)
    C8B2 = (80, 20)
    C9B1 = (90, 10)